﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IntegerArray
{
    class ExtendedArray
    {
        readonly int[] array;
        readonly int sum;
        public ExtendedArray(int[] array)
        {
            this.array = (int[])array.Clone();
            Array.Sort(this.array);
            foreach(int n in this.array)
            {
                sum += n;
            }
        }
        public int Max()
        {
            return array[array.Length - 1];
        }
        public int Min()
        {
            return array[0];
        }
        public int Sum()
        {
            return sum;
        }
        public double Average()
        {
            return (double)sum / array.Length;
        }
    }
}
